import request from '@/utils/request'
//获取角色列表
export function getRoleListAPI() {
    return request({
        url: '/park/sys/role',
        method: 'get',

    })
}

//获取角色权限列表
export function getTreeListAPI() {
    return request({
        url: '/park/sys/permision/all/tree',
        method: 'get',

    })
}

//查询详细列表
export function getSearchListAPI(roleId) {
    return request({
        url: `/park/sys/role/${roleId}`,
        method: 'get',
        // https: //api-hmzs.itheima.net/v1/park/sys/role/{roleId}

    })
}
//获取角色下面的用户列表
export function getRoleUserAPI(roleId) {
    return request({
        url: `/park/sys/roleUser/${roleId}`,
        method: 'get',


    })
}

//确认添加角色
export function addRoleAPI(data) {
    return request({
        url: '/park/sys/role',
        method: 'post',
        data

    })
}
//编辑角色
export function updateRoleAPI(data) {
    return request({
        url: `/park/sys/role`,
        method: 'PUT',
        data
    })
}
//删除角色
export function delRoleUserAPI(roleId) {
    return request({
        url: `/park/sys/role/${roleId}`,
        method: 'DELETE'
    })
}
//获取员工列表
export function getEmployeeListAPI(params) {
    return request({
        url: '/park/sys/user',
        params
    })
}
//添加员工
export function createEmployeeAPI(data) {
    return request({
        url: `/park/sys/user`,
        method: 'POST',
        data
    })
}


//删除员工

export function delEmployeeAPI(id) {
    return request({
        url: `/park/sys/user/${id}`,
        method: 'DELETE'
    })
}

//系统管理-登录成功-查询登录人用户、角色和权限信息
export function getProfileAPI() {
    return request({
        url: '/park/user/profile',
        method: 'get'
    })
}
